﻿using BuzzX8.Xmpp.StreamElements.Stanza;

namespace BuzzX8.Xmpp.StreamElements.Factories
{
    public class PresenceStanzaFactory : StanzaFactory<PresenceStanzaType, PresenceStanza, PresenceModel>
    {
        protected override PresenceModel CreateModelByParameters(PropertyDictionary parameters)
        {
            return new PresenceModel(parameters);
        }

        protected override PresenceStanza CreateNewElement()
        {
            return new PresenceStanza();
        }

        protected override void UpdateElementByModel(PresenceStanza element, PresenceModel model)
        {
            base.UpdateElementByModel(element, model);
            element.Availability = model.Availability;
            element.Priority = model.Priority;
            element.StatusText = element.StatusText;
        }
    }
}
